package eu.telecom_bretagne.xml_parser;

import java.util.LinkedList;



	public class Way{
		private int id;
		private LinkedList<Node> nodes;
		private String name, highway, ref;

		public Way(){}

		public int getId(){return id;}
		public String getName(){return name;}
		public String getHighWay(){return highway;}
				
		public void setId(int id){this.id = id;}
		public void setName(String name){this.name= name;}
		public void setHighway(String place){this.highway = place;}
		
		public LinkedList<Node> getNodes() {
			return nodes;
		}

		public void setNodes(LinkedList<Node> nodes) {
			this.nodes = nodes;
		}
		
		public void addNode(Node node){
			this.nodes.add(node);
		}
		
		public String getRef() {
			return ref;
		}

		public void setRef(String ref) {
			this.ref = ref;
		}
		
		public String toString(){
			
			String nodeIds = "";
			for(Node n : nodes){
				nodeIds += String.valueOf(n.getId());
				nodeIds += " ,";
			}
			return new StringBuffer(id + "- Name: ").append(name).append(", ")
				.append("Waytype: ").append(", ").append("Highway: ").append(highway).append(", ").append("Ref: ").append(ref).append(", ").append("Nodes: ").append(nodeIds)
				.toString();
		}		
	
}
